// 编程实现Person类的定义
public class Person{
	// 1.私有化成员变量，使用priva关键字修饰
	private int age;
	private String name;

	// 3.创建构造方法，在构造方法中调用set方法初始化成员变量
	public Person(){
		System.out.println("no Person");
	}
	public Person(int age, String name){
		System.out.println(" Person");
		setAge(age);
		setName(name);
	}


	// 2.提供公有的set/get成员方法，并在方法体对参数做合理判断
	public void setAge(int age){
		if (age <= 0) {
			age = 1;
		}
		this.age = age;
	}
	public void setName(String name){

		this.name = name;
	}

	public int getAge(){
		return this.age;
	}
	public String getName(){
		return this.name;
	}

	//Person类其他方法
	public void eat(String food){
		System.out.println(food + "is very good!! ");
	}

	public void show(){
		System.out.println("my name is " + name + ", age is " + age);
	}

	public void play(String game){
		System.out.println(game + "is good");
	}




}